Increase the default timeout for slow tests
authorEmmanuele Bassi <ebassi@gnome.org>
Fri, 10 Jul 2020 15:12:25 +0000 (16:12 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Fri, 10 Jul 2020 15:13:37 +0000 (16:13 +0100)
If a test is part of the 'slow' test suite, we should increment the
default timeout to compensate.

testsuite/gtk/meson.build

index a93540dd806b2b1ab9b77849eeb085b1aa7927d3..d725d992f644e8e2958a8ae5873c665a1a24ab6a 100644 (file)
@@ -107,6 +107,8 @@ foreach t : tests
   test_srcs = ['@0@.c'.format(test_name)] + t.get(1, [])
   test_extra_cargs = t.get(2, [])
   test_extra_ldflags = t.get(3, [])
+  test_extra_suites = t.get(4, [])
+  test_timeout = 60
 
   test_exe = executable(test_name, test_srcs,
     c_args : test_cargs + test_extra_cargs,
@@ -117,17 +119,21 @@ foreach t : tests
 
   expect_fail = xfail.contains(test_name)
 
+  if test_extra_suites.contains('slow')
+    test_timeout = 90
+  endif
+
   test(test_name, test_exe,
        args: [ '--tap', '-k' ],
        protocol: 'tap',
-       timeout: 60,
+       timeout: test_timeout,
        env: [
               'NO_AT_BRIDGE=1',
               'GSK_RENDERER=cairo',
               'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
               'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
             ],
-       suite: 'gtk',
+       suite: ['gtk'] + test_extra_suites,
        should_fail: expect_fail,
   )
 endforeach